from django.http import HttpResponse

# see: http://docs.djangoproject.com/en/1.1/topics/http/shortcuts/#django.shortcuts.render_to_response


# from django.template import Context, loader as Loader
# def index(request):
#     loader = Loader.get_template('display/index.html')
#     context = Context(
#         { 'hello_header': 'Hello! This is display index page using loader and Context'
#           } )
#     return HttpResponse(loader.render(context))


# from django.template import loader as Loader
# def index(request):
#     s = Loader.render_to_string('display/index.html', { 'hello_header': 'Hello! This is display index page using render_to_string'})
#     return HttpResponse(s)


# from django.shortcuts import render_to_response
# def index(request):
#     return render_to_response('display/index.html', {'hello_header': 'Hello! This is display index page using render_to_response'})


from with_template import *
@with_template('display/index.html')  # optional
def index(request):
    return {'hello_header': 'Nice to meet you! with_template',
            'books' : ['Aaaa','Bbbb', 'Ccccc'],
            }


def show_detailed(request, i):
    i = int(i)
    return HttpResponse( "Displaying %d ..." % i )
